﻿@{
    Layout = null;
    List<EnterpriseFund.Model.FinanceProp> financePropList = (ViewData["FinancePropList"] == null ? new List<EnterpriseFund.Model.FinanceProp>() : ViewData["FinancePropList"] as List<EnterpriseFund.Model.FinanceProp>);
    List<EnterpriseFund.Model.EnterpriseProp> EnterprisePropList = (ViewData["EnterprisePropList"] == null ? new List<EnterpriseFund.Model.EnterpriseProp>() : ViewData["EnterprisePropList"] as List<EnterpriseFund.Model.EnterpriseProp>);

    EnterpriseFund.Controllers.QueryAllowanceController q = new EnterpriseFund.Controllers.QueryAllowanceController();
     }

    @model System.Data.DataTable
<!DOCTYPE html>

<html>
<head>
   <title>补贴信息查询</title>
    @if (false)
    {
    
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.DropDownEdit, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.ComboBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.TextBox, Theme = DevExpressHelper.Theme }
)
     <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/checkinput.js")" type="text/javascript"></script>
    <style>
        #form_query
        {
        }
        .hide
        {
            display: none;
        }
        input, select
        {
            border: 1px solid #aecaf0;
        }
        input.txt, select.txt
        {
            width: 99%;
        }
        input.btn
        {
            padding: 3px 10px 2px;
            border: #a3c0e8 1px solid;
            background: #e2f0ff url(/EnterpriseFund/DXR.axd?r=0_54) repeat-x 50% top;
            color: #2c4d79;
            cursor: pointer;
        }
        input.btn:hover
        {
            background-image: url(/EnterpriseFund/DXR.axd?r=0_57);
        }
        th
        {
            text-align: right;
        }
    </style>
    <script type="text/javascript">
        var rootUrl = '@Url.Content("~/QueryAllowance/")';
        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;


          //  var nKHYH = $("#hKHYH").val();
    var   NSRMC=    $("#hNSRMC").val();
   var FFinance= $("#hFFinance").val();
      var  NSRBM=    $("#hNSRBM").val();
     var   NSRSBH=     $("#hNSRSBH").val(); 
      var      FNewEnterprise=                      $("#hFNewEnterprise").val();
       var  FIssueID=  $("#hFIssueID").val();
      var  ISPAY=    $("#hISPAY").val();
      var  FYear=     $("#hFYear").val();
      var   BTJEA=     $("#hBTJEA").val();
      var BTJEB=    $("#hBTJEB").val();
     var   FApplyDate=    $("#hFApplyDate").val();
     var   LastPayDate=     $("#hLastPayDate").val();
     var   ISBASE=      $("#hISBASE").val();
   var  FFileNo=      $("#hFFileNo").val();
    var    SKSJA=    $("#hSKSJA").val();
     var  SKSJB =      $("#hSKSJB").val();
  
            //            var FNote = $("#hFNote").val();
            //            var FPayDateBegin = $("#hFPayDateBegin").val();
            //            var FPayDateEnd = $("#hFPayDateEnd").val();

     e.customArgs["NSRMC"] = NSRMC;
     e.customArgs["FFinance"] = FFinance;
     e.customArgs["NSRBM"] = NSRBM;
     e.customArgs["NSRSBH"] = NSRSBH;
     e.customArgs["FNewEnterprise"] = FNewEnterprise;
     e.customArgs["FIssueID"] = FIssueID;
     e.customArgs["ISPAY"] = ISPAY;
     e.customArgs["FYear"] = FYear;
     if (BTJEA != null && BTJEA != "") 
     {
          e.customArgs["BTJEA"] = parseInt(BTJEA) * 10000;
        // e.customArgs["BTJEA"] = BTJEA;
     }
 if (BTJEB != null && BTJEB != "") 
     {
            e.customArgs["BTJEB"] = parseInt(BTJEB) * 10000;
       //  e.customArgs["BTJEB"] = BTJEB;
     }
     e.customArgs["FApplyDate"] = FApplyDate;
     e.customArgs["LastPayDate"] = LastPayDate;
     e.customArgs["ISBASE"] = ISBASE;
     e.customArgs["FFileNo"] = FFileNo;
     if (SKSJA != null && SKSJA != "") 
     {
          e.customArgs["SKSJA"] = parseInt(SKSJA) * 10000;
        // e.customArgs["SKSJA"] = SKSJA;
     }
       if (SKSJB!= null && SKSJB != "") 
     {
          e.customArgs["SKSJB"] = parseInt(SKSJB) * 10000;
       //  e.customArgs["SKSJB"] = SKSJB;
     }
            //   e.customArgs["FNote"] = FNote;
            //            e.customArgs["FPayDateBegin"] = FPayDateBegin;
            //            e.customArgs["FPayDateEnd"] = FPayDateEnd;
            //  e.customArgs[""] = ;

            //     alert(1);
        }

        //查询
        function search() {

//            $("#hKHYH").val(KHYH1.GetText());
//            //   $("#hnsrbm").val(NSRBM1.GetText());
//            $("#hnsrmc").val(NSRMC1.GetText());
//            $("#hFFinance").val(FFinance1.GetValue());
//            // $("#hFAmount1").val(FAmount1.GetText());
//            // $("#hFAmount2").val(FAmount2.GetText());
//            $("#hFFileNo").val(FFileNo1.GetText());
//            $("#hSFBF").val(SFBF1.GetChecked());

            $("#hNSRMC").val(NSRMC1.GetText());
       $("#hFFinance").val(FFinance1.GetValue());
        $("#hNSRBM").val(NSRBM1.GetText());
         $("#hNSRSBH").val( NSRSBH1.GetText());
                              $("#hFNewEnterprise").val(FNewEnterprise1.GetValue());
       $("#hFIssueID").val(FIssueID1.GetText());
        $("#hISPAY").val(ISPAY1.GetChecked());
         $("#hFYear").val(FYear1.GetText());

         $("#hBTJEA").val(BTJEA1.GetText());



               $("#hBTJEB").val(BTJEB1.GetText());
           
             if (FApplyDate1.GetDate() != null) 
          {
              $("#hFApplyDate").val(FApplyDate1.GetText());
             }
             if (LastPayDate1.GetDate() != null) 
          {
              $("#hLastPayDate").val(LastPayDate1.GetText());
             }
       
          $("#hISBASE").val(ISBASE1.GetChecked());
       $("#hFFileNo").val(FFileNo1.GetText());
        $("#hSKSJA").val(SKSJA1.GetText());
        $("#hSKSJB").val(SKSJB1.GetText());







            //  $("#hFNote").val(FNote1.GetText());
            //  $("#hFPayDateBegin").val(FPayDateBegin1.GetText());
            //  $("#hFPayDateEnd").val(FPayDateEnd1.GetText());
            //              var fspecialAdjustName = FSpecialAdjustName.GetValue();
            //               var rKRQBeginDate = RKRQBeginDate.GetValue();
            //                var rKRQEndDate = RKRQEndDate.GetValue();
            // if (CheckValues())
            //            if ((!isNaN(FAmount1.GetText())) & (!isNaN(FAmount2.GetText()))) {
            //                gvEditing.Refresh();
            //            }
            //            else if (FAmount1.GetText() == "" & FAmount2.GetText() == "") {
            //                gvEditing.Refresh();
            //            }
            //            else {
            //                $("#hFAmount1").val("");
            //                $("#hFAmount2").val("");
            //                alert("拨款金额输入必须为数字,且不为空");
        //            }
        $("#hsearched").val("T");
            gvEditing.Refresh();

        }


        //重置
        function undo() {
            ISPAY1.SetChecked(false);
            ISBASE1.SetChecked(false);

            //            $("#nsrsbh").val("");
            //            $("#nsrbm").val("");
            //            $("#nsrmc").val("");
            //            $("#fIssueNo").val("");
            //             NSRSBH1.val("");
            //            KHYH1.SetText("");
            //            NSRBM1.SetText("");
            //            NSRMC1.SetText("");
            FFinance1.SetValue("");
            FNewEnterprise1.SetValue("");
            //            FAmount1.SetText("");
            //            FAmount2.SetText("");
            //            FFileNo1.SetText("");
            //            FNote1.SetText("");
            //            FPayDateBegin1.SetText("");
            //            FPayDateEnd1.SetText("");

          
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnExcel":
                    {

                        //if (CheckValues())

                          if ($("#hsearched").val() == "T") {
                        form_query.target = '_self';
                        form_query.action = rootPath + "/QueryAllowance/ExportToXls";
                        form_query.submit();
                        }
                        break;


                    }
                case "btnReport":
                    {
                      if ($("#hsearched").val() == "T") {
                        window.showModalDialog(rootPath + "/QueryAllowance/Print", window, "dialogWidth=800px;dialogHeight=500px");
                        }
                        
                        //if (CheckValues())
//                        form_query.target = '_blank';
//                        //  form_query.target = 'parent.contentframe';
//                        //  parent.contentframe.url(
//                        form_query.action = rootPath + "/QueryAllowance/Print";
//                        form_query.submit();
                        break;


                    }
                case "btnGridShow":
                    {
                        gvEditing.ShowCustomizationWindow();
                        break;
                    }
                    
            }
        }

        function keyPress() {
            if (event.keyCode && event.keyCode == 13) {
                search();

            }

        }
    </script>
</head>
<body   onkeypress="keyPress()">
     @Html.Partial("LoadPanelPartial")
    @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnExcel";
        item.Text = "导出Excel";
        item.Image.Url = Url.Content("~/Content/ControlImages/excel.png");
    });
    settings.Items.Add(item =>
    {
        item.Name = "btnReport";
        item.Text = "打印";
        item.Image.Url = Url.Content("~/Content/icons/print.png");
    });
    settings.Items.Add(item =>
    {
        item.Name = "btnGridShow";
        item.Text = "选择列";
        item.Image.Url = Url.Content("~/Content/FunctionImages/AllowanceFileAudit.png");
    });
    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    @using (Html.BeginForm("ExportToXls", "QueryAllowance", FormMethod.Post, new { id = "form_query" }))
    {
      
        <table class="query" width="800px" style="margin-left: auto; margin-right: auto">
            <tr>
               <td align="right" style="text-align:right">
                    企业名称：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRMC1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.nsrmc).GetHtml()
                </td>
                 <td align="right" style="text-align:right">
                    纳税编码：
                </td>
               
                <td>
                <table>
                <tr>
                <td>
                           @Html.DevExpress().TextBox(settings =>
                      {
                          settings.Name = "NSRBM1";
                          settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
                      }).Bind(ViewBag.NSRBM).GetHtml()

                   </td>
                 
                </tr>
                </table>      
                    
               
                </td>
          
               <td  align="right" style="text-align:right">
                    补贴金额：
                </td>
               <td >
                <table>
                <tr>
                <td>
                 @Html.DevExpress().TextBox(settings =>
            {
                settings.Name = "BTJEA1";
                settings.Width = System.Web.UI.WebControls.Unit.Pixel(90);
            }).Bind(ViewBag.BTJEA).GetHtml()
                </td>
                    <td> - </td>
                    <td>
                           @Html.DevExpress().TextBox(settings =>
                      {
                          settings.Name = "BTJEB1";
                          settings.Width = System.Web.UI.WebControls.Unit.Pixel(90);
                      }).Bind(ViewBag.BTJEB).GetHtml()    
                         
                </td>
                </tr>
                </table>
               </td>
                
                
               @* <td align="left" style="text-align:left">
                    
                </td>*@
                    <td colspan="2">
                    <table>
                        <tr>
                            <td>
                                @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnSearch";
                               settings.Text = "查询";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                               settings.ClientSideEvents.Click = "search";
                           }).GetHtml()
                            </td>
                            
                            <td>
                                @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnUndo";
                               settings.Text = "重置";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                               settings.ClientSideEvents.Click = "undo";
                           }).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
               
            </tr>
            <tr>
             <td align="right" style="text-align:right">
                    纳税人识别号：
                </td>
               
                <td>
               
                           @Html.DevExpress().TextBox(settings =>
                      {
                          settings.Name = "NSRSBH1";
                          settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                      }).Bind(ViewBag.NSRSBH).GetHtml()

                       
                    
               
                </td>
           
               
              <td  align="right" style="text-align:right">
                    期号：
                </td>
                <td>
                 <table>
                <tr>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FIssueID1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
               }).Bind(ViewBag.FIssueID).GetHtml()
           </td> 
           </tr>
                </table>
                       </td>
                <td  align="right" style="text-align:right">
                    税款数据：
                    </td>
                <td >
                <table>
                <tr>
                <td>
                 @Html.DevExpress().TextBox(settings =>
            {
                settings.Name = "SKSJA1";
                settings.Width = System.Web.UI.WebControls.Unit.Pixel(90);
            }).Bind(ViewBag.SKSJA).GetHtml()
                </td>
                    <td> - </td>
                    <td>
                               @Html.DevExpress().TextBox(settings =>
                          {
                              settings.Name = "SKSJB1";
                              settings.Width = System.Web.UI.WebControls.Unit.Pixel(90);
                          }).Bind(ViewBag.SKSJB).GetHtml()
                </td>
                </tr>
                </table>
               </td>   
               
                <td colspan="2">
                  
               
               @Html.DevExpress().CheckBox(settings =>
              {
                  settings.Name = "ISBASE1";
                  settings.Text = "有基数的企业";
                  // settingsCheckBox.Properties.ClientSideEvents.CheckedChanged = string.Format("function(s, e) {{ if(s.GetChecked()) {0}.SelectAllRowsOnPage(); else {0}.UnselectAllRowsOnPage(); }}", settings.Name);


                  //      settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                  //settings.Properties.ValidationSettings.EnableCustomValidation = true;

              }).GetHtml()
                
                </td>
              
            </tr>
              <tr> 
               <td  align="right" style="text-align:right">
                    补贴年度：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FYear1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.FYear).GetHtml()
                </td>
              
                     <td align="right" style="text-align:right">
                    资金性质：
                </td>
                <td>
                 
           <table>
                <tr>
                <td>
                @Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FFinance1";
               settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
               settings.Properties.TextField = "FFinancePropShortName";
               settings.Properties.ValueField = "FFinancePropNo";
               settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
               settings.Properties.DropDownStyle = DropDownStyle.DropDown;
               //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";

           }).BindList(ViewData["FinancePropList"]).Bind(ViewBag.FFinance).GetHtml()
              </td></tr></table>  </td>

              <td  align="right" style="text-align:right">
                    补贴日期：
                </td>
                   
                <td  >
                <table>
                <tr>
                <td>
                @Html.DevExpress().DateEdit(settings =>
           {
               settings.Name = "FApplyDate1";
               settings.Width = System.Web.UI.WebControls.Unit.Pixel(90);
               settings.Properties.ShowShadow = true;
               settings.Properties.EditFormat = EditFormat.Date;
               settings.Properties.EditFormatString = "yyyy-MM-dd";
               settings.Properties.MinDate = DateTime.Parse("1900-01-01");
               settings.Properties.UseMaskBehavior = true;
           }).Bind(ViewBag.FApplyDate).GetHtml()
                </td>
                    <td> - </td>
                    <td>
                               @Html.DevExpress().DateEdit(settings =>
                          {
                              settings.Name = "LastPayDate1";
                              settings.Width = System.Web.UI.WebControls.Unit.Pixel(90);
                              settings.Properties.ShowShadow = true;
                              settings.Properties.EditFormat = EditFormat.Date;
                              settings.Properties.EditFormatString = "yyyy-MM-dd";
                              settings.Properties.MinDate = DateTime.Parse("1900-01-01");
                              settings.Properties.UseMaskBehavior = true;
                          }).Bind(ViewBag.LastPayDate).GetHtml()
                </td>
                 
                </tr>
                </table>
               </td>

                <td colspan="2">
                 @Html.DevExpress().CheckBox(settings =>
              {
                  settings.Name = "ISPAY1";
                  settings.Text = "资金已拨付";
                  settings.ClientVisible = false;
                  // settingsCheckBox.Properties.ClientSideEvents.CheckedChanged = string.Format("function(s, e) {{ if(s.GetChecked()) {0}.SelectAllRowsOnPage(); else {0}.UnselectAllRowsOnPage(); }}", settings.Name);


                  //      settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                  //settings.Properties.ValidationSettings.EnableCustomValidation = true;

              }).GetHtml()
                  
                </td>
                
                </tr>
                <tr>
                <td  align="right" style="text-align:right">
                    文件号：
                </td>
                <td>
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FFileNo1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
               }).Bind(ViewBag.FFileNo).GetHtml()
                </td>
                   <td align="right" style="text-align:right">
                    企业类型：
                </td>
                <td>
                
           <table>
                <tr>
                <td>
                @Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FNewEnterprise1";
               settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
               settings.Properties.TextField = "FEnterprisePropName";
               settings.Properties.ValueField = "FEnterprisePropNo";
               settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
               settings.Properties.DropDownStyle = DropDownStyle.DropDown;
               //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";

           }).BindList(ViewData["EnterprisePropList"]).Bind(ViewBag.FNewEnterprise).GetHtml()
             </td></tr></table>   </td>
                
                   <td colspan="4"> <p style="color: #FF0000; white-space: nowrap; line-height: normal; text-indent: 18px;" > 注:补贴金额和税款数据单位为万元</p></td>
                </tr>
        </table>
       @Html.Partial("QueryAllowanceListPartial", Model)
       @Html.Hidden("hNSRMC","");
       @Html.Hidden("hFFinance","");
       @Html.Hidden("hNSRBM","");
       @Html.Hidden("hNSRSBH",""); 
       @Html.Hidden("hFNewEnterprise","");
       @Html.Hidden("hFIssueID","");
       @Html.Hidden("hISPAY","");
       @Html.Hidden("hFYear","");
       @Html.Hidden("hBTJEA","");
       @Html.Hidden("hBTJEB","");
       @Html.Hidden("hFApplyDate","");
       @Html.Hidden("hLastPayDate","");
       @Html.Hidden("hISBASE","");
       @Html.Hidden("hFFileNo","");
       @Html.Hidden("hSKSJA","");
       @Html.Hidden("hSKSJB","");
                                @Html.Hidden("hsearched", "F")
    }
</body>
</html>
